package com.collect.tanzania.zhiAdater.zhiPerfermance;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.collect.tanzania.R;
import com.collect.tanzania.zhiBean.zhiReceive.ZHIRPerfermanceEntity;

public class CTPerfermanceAdjuster extends BaseQuickAdapter<ZHIRPerfermanceEntity, BaseViewHolder> {

    public CTPerfermanceAdjuster() {
        super(R.layout.item_prefermance_list, null);
    }

    private OnPerfermanceItemClickListener mOnPerfermanceItemClickListener;

    @Override
    protected void convert(BaseViewHolder helper, final ZHIRPerfermanceEntity caseEntity) {

        helper.setText(R.id.tv_p_date, caseEntity.getOverdueDate());
        helper.setText(R.id.tv_p_case_num, caseEntity.getTotalCaseNum());
        helper.setText(R.id.tv_p_repay_case_num, caseEntity.getTotalOverdueSettleOrderNum());
        helper.setText(R.id.tv_p_collect_rate, caseEntity.getTotalOverdueSettleRate());
        helper.addOnClickListener(R.id.ll_content);

        if (mOnPerfermanceItemClickListener != null) {
            helper.getView(R.id.ll_content).setOnClickListener(view -> mOnPerfermanceItemClickListener.OnItemClick(caseEntity));
        }
    }

    public void setOnPerfermanceItemClickListener(OnPerfermanceItemClickListener perfermanceItemClickListener) {
        this.mOnPerfermanceItemClickListener = perfermanceItemClickListener;
    }

    public interface OnPerfermanceItemClickListener {
        void OnItemClick(ZHIRPerfermanceEntity caseEntity);
    }
}



